<ul class="nav nav-tabs nav-tabs--course  {% if mobile %} es-mobile-nav {% endif %}" role="tablist">
  {% for key, tab in metas.tabs if( key not in ['material', 'threads']  or navMember|default(null)) %}
    {% if  (mobile and loop.index <= 3) or (not mobile) %}
      <li role="presentation" id="{{ key }}"
          class="{% if route_params.tab|default('') == key  or nav|default('') == key %}active{% endif %}">
        <a
          {% if member|default(false) %}
            href="{{ path('my_course_show', {'id': course.id, 'tab': key, previewAs:previewAs}) }}"
          {% else %}
            href="{{ path('course_show', {'id': course.id, 'tab': key, previewAs:previewAs}) }}"
          {% endif %}
        >
          {{ tab.name|trans }}
          {% if key == 'tasks' and categoryTag|default(null) %}
            <span class="badge badge-primary">{{ categoryTag|trans }}</span>
          {% endif %}
          {% if tab.number|default(false) %}
            {% if member|default(false) %}
              <small>({{ course[tab.number]|default(0) }})</small>
            {% else %}
              <small>({{ course_set[tab.number]|default(0) }})</small>
            {% endif %}
          {% endif %}
        </a>
      </li>
    {% endif %}
  {% endfor %}
</ul>